dhcpv6-ia: simplify/fix IID calculations
authorDavid Härdeman <[email protected]>
Sat, 25 Oct 2025 10:25:33 +0000 (12:25 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Sun, 26 Oct 2025 21:27:22 +0000 (22:27 +0100)
commit14da3727ac0ce89df0d1a80f4e29d3a8b04b1d9c
tree7080bc70d570f9dc7e94a70807308b3e289b230b
parentf49574e42e78cff0eeeb4d00e62b875c915e9511
dhcpv6-ia: simplify/fix IID calculations

This is a first stab at simplifying the IID calculations introduced with
commit 7000557cd8f6396b82cb35e0cdf9b72b18288fbc.

See the discussion in:
https://github.com/openwrt/openwrt/issues/20523

Note that a "cold" jrand48() doesn't have much of an avalance effect in
case of two very similar DUIDs, but it shouldn't matter because we're
not looking for any kind of cryptographic randomness...just a
predictable PRNG where the same DUID will (usually) get the same IPv6
addr (if available).

Closes: https://github.com/openwrt/odhcpd/issues/293
Closes: https://github.com/openwrt/openwrt/issues/20523
Fixes: 7000557cd8f6 ("dhcpv6-ia: respect prefix assigned to interface (>= /64)")
Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/290
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/dhcpv6-ia.c